package org.achartengine.internal.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes2.dex */
public class h implements Serializable {
    private String a;
    private List<Double> b = new ArrayList();
    private List<Double> c = new ArrayList();
    private double d = Double.MAX_VALUE;
    private double e = -1.7976931348623157E308d;
    private double f = Double.MAX_VALUE;
    private double g = -1.7976931348623157E308d;

    public h(String str) {
        this.a = str;
        h();
    }

    private void h() {
        this.d = Double.MAX_VALUE;
        this.e = -1.7976931348623157E308d;
        this.f = Double.MAX_VALUE;
        this.g = -1.7976931348623157E308d;
        int c = c();
        for (int i = 0; i < c; i++) {
            b(b(i), c(i));
        }
    }

    private void b(double d, double d2) {
        this.d = Math.min(this.d, d);
        this.e = Math.max(this.e, d);
        this.f = Math.min(this.f, d2);
        this.g = Math.max(this.g, d2);
    }

    public String a() {
        return this.a;
    }

    public void a(String str) {
        this.a = str;
    }

    public synchronized void a(double d, double d2) {
        this.b.add(Double.valueOf(d));
        this.c.add(Double.valueOf(d2));
        b(d, d2);
    }

    public synchronized void a(int i) {
        double doubleValue = this.b.remove(i).doubleValue();
        double doubleValue2 = this.c.remove(i).doubleValue();
        if (doubleValue == this.d || doubleValue == this.e || doubleValue2 == this.f || doubleValue2 == this.g) {
            h();
        }
    }

    public synchronized void b() {
        this.b.clear();
        this.c.clear();
        h();
    }

    public synchronized double b(int i) {
        return this.b.get(i).doubleValue();
    }

    public synchronized double c(int i) {
        return this.c.get(i).doubleValue();
    }

    public synchronized int c() {
        return this.b.size();
    }

    public double d() {
        return this.d;
    }

    public double e() {
        return this.f;
    }

    public double f() {
        return this.e;
    }

    public double g() {
        return this.g;
    }
}
